package Game;

import java.util.LinkedList;

public abstract class GameObject {
	public float x, y, z;
	public float scaleX, scaleY, scaleZ;
	public float rotateX, rotateY, rotateZ;
	public GameObject parent;
	public String parentName;
	public boolean alive = true;
	public LinkedList<GameObject> childList = new LinkedList<GameObject>();
	public float collisionR = 2;

	public GameObject(float x, float y, float z) {
		super();
		this.x = x;
		this.y = y;
		this.z = z;

		scaleX = 1;
		scaleY = 1;
		scaleZ = 1;
		
		rotateX = 0;
		rotateY = 0;
		rotateZ = 0;
	}

	abstract public void Update(long diftime);

	abstract public void Render();

	public void addChild(GameObject child) {
		child.parent = this;
		childList.add(child);
	}
	
	public void removeChild(GameObject child) {
		childList.remove(child);
	}
}
